<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <div id="navigation" style="left: 0px; top: 0px;width:100%" align="center">
      <div style="padding-left:206px;">
        <ul id="sitenav" class="navlist">
          <xsl:for-each select="SiteMenu/menu">
            <li class="menuleft">
            </li>
            <li class="menu">
              <a class="topmenu">
                <xsl:choose>
                  <xsl:when test="@text = 'News'">
                    <xsl:attribute name ="onmouseover">OpenSubMenuNews(this);</xsl:attribute>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:attribute name ="onmouseover">OpenSubMenu(this);</xsl:attribute>
                  </xsl:otherwise>
                </xsl:choose>
                <xsl:attribute name="href">
                  <xsl:value-of select="@href"/>
                </xsl:attribute>
                <xsl:attribute name="title">
                  <xsl:value-of select="@text"/>
                </xsl:attribute>
                <xsl:attribute name="id">
                  <xsl:value-of select="@id"/>
                </xsl:attribute>
                <xsl:attribute name="name">
                  <xsl:value-of select="@id"/>
                </xsl:attribute>
                <xsl:value-of select="@text"/>
              </a>
            </li>
            <li class="menuright">
            </li>
          </xsl:for-each>
        </ul>
      </div>
      <xsl:for-each select="SiteMenu/menu">
        <xsl:if test="menu">
          <div class="fly-out" align="left">
            <xsl:attribute name="style">
              <xsl:value-of select="concat('width	:',@width,';height:',@height,';visibility: hidden; left: 230px;top: 159px;')" />
            </xsl:attribute>
            <xsl:attribute name="id">
              <xsl:value-of select="concat('p_',@id)"/>
            </xsl:attribute>
            <div id="loader" style="padding-top:30px;" align="center">
              <img src="/images/loading-spinner.gif" alt="Loading..." />
              <span id="loaderText">Loading...</span>
            </div>
          </div>
        </xsl:if>
      </xsl:for-each>
    </div>
  </xsl:template>
  <xsl:template name="submenu">
    <div id="navigation" style="left: 0px; top: 0px">
      <xsl:for-each select="submenu">
        <ul id="sitenav" class="navlist">
          <xsl:for-each select="menu">
            <li>
              <a onmouseover="OpenSubMenu(this);" class="topmenu" onclick="return false;">
                <xsl:attribute name="href">
                  <xsl:value-of select="@href"/>
                </xsl:attribute>
                <xsl:attribute name="title">
                  <xsl:value-of select="@text"/>
                </xsl:attribute>
                <xsl:attribute name="id">
                  <xsl:value-of select="@id"/>
                </xsl:attribute>
                <xsl:attribute name="name">
                  <xsl:value-of select="@id"/>
                </xsl:attribute>
                <xsl:value-of select="@text"/>
              </a>
            </li>
          </xsl:for-each>
        </ul>
      </xsl:for-each>
      <xsl:for-each select="submenu/menu">
        <div class="fly-out" style="visibility: hidden; left: 230px;top: 159px;">
          <xsl:attribute name="id">
            <xsl:value-of select="concat('p_',@id)"/>
          </xsl:attribute>
          <xsl:if test="submenu/menu">
            <xsl:call-template name="submenu"/>
          </xsl:if>
        </div>
      </xsl:for-each>
    </div>
  </xsl:template>
</xsl:stylesheet>

